home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Development Platforms / Apple II / Essentials / Technical.Notes / PDOS / TN.PDOS.027 < prev    next >
Encoding:
Text File  |  1990-04-03  |  3.7 KB  |  73 lines  |  [TEXT/pdos]

  1. Apple II
  2. Technical Notes
  3. _____________________________________________________________________________
  4.                                                   Developer Technical Support
  5.  
  6. ProDOS 8
  7. #27:    Hybrid Applications
  8.  
  9. Written by:    Matt Deatherage                                     March 1990
  10.  
  11. This Technical Note discusses considerations for "hybrid" applications, which 
  12. use Apple IIGS-specific features from ProDOS 8.
  13. _____________________________________________________________________________
  14.  
  15. Why Use Hybrid Features?
  16.  
  17. There are many reasons not to write hybrid applications.  If your target 
  18. machine is the Apple IIGS, it's pretty silly to write a ProDOS 8-based 
  19. application.  You are limited to the slower I/O model of ProDOS 8, you cannot 
  20. access foreign file systems or large CD-ROM volumes, you cannot reliably 
  21. access the toolbox (patches to the toolbox are only loaded when GS/OS is 
  22. booted, which forces you to require GS/OS to be booted), and you cannot work 
  23. with desk accessories that do disk access (CDAs cannot reliably "save and 
  24. restore" an area of bank zero to use for ProDOS 8 disk access because they 
  25. don't know if an interrupt handling routine is located there).
  26.  
  27. However, applications targeted for all Apple II computers may reasonably wish 
  28. to take advantage of IIGS features.  For example, a word processor or 
  29. telecommunications program may want to use extra IIGS memory.  This Note is 
  30. your spiritual guide to such features.
  31.  
  32.  
  33. Memory Management
  34.  
  35. Applications wishing to use extended (beyond the lower 128K) memory on the 
  36. IIGS must, like all IIGS applications, get it from the Memory Manager.  This 
  37. is not a consideration for non-hybrid applications for two reasons.  First, 
  38. when GS/OS launches a ProDOS 8 program, it reserves all of the lower 128K 
  39. memory for ProDOS 8, so no other component (tool, desk accessory, INIT) can 
  40. accidentally use that memory.  (In fact, if some of the memory is not 
  41. available, GS/OS refuses to launch ProDOS 8 at all.)  Second, when ProDOS 8 is 
  42. directly booted, none of the memory is allocated since these other components, 
  43. which might be using the Memory Manager, aren't loaded either.
  44.  
  45. If your ProDOS 8 application was launched by GS/OS, all of the managed lower 
  46. 128K has already been allocated for you by GS/OS.  If you call MMStartUp, the 
  47. user ID returned is one belonging to GS/OS.  In such cases, the auxiliary 
  48. field of the user ID is already being used by GS/OS and must not be altered by 
  49. your application.  You also must not call any Memory Manager routine which 
  50. works on all handles of a given user ID, such as DisposeAll or HUnlockAll.  
  51. You must manage all handles individually and not by user ID.  You may, if you 
  52. wish, call GetNewID to get a new user ID for use in a user ID-based memory 
  53. management system.  The ID should be of type $1000 (application).
  54.  
  55. You can tell whether your application was launched by GS/OS by checking 
  56. OS_BOOT, the byte value at $E100BD.  OS_BOOT is $00 when the boot OS was 
  57. ProDOS 8, indicating that your application was not loaded by GS/OS.  If this 
  58. is the case and you want to use extended IIGS memory, you should call GetNewID 
  59. to obtain a new application ID then use NewHandle to allocate four handles to 
  60. hold the memory normally reserved for ProDOS 8 by GS/OS.  You should obtain 
  61. memory at $00/0800 (size $B800), $01/0800 (size $B800), $E0/2000 (size $4000) 
  62. and $E1/2000 (size $8000).  You may then use MMStartUp to register yourself 
  63. with the Memory Manager; MMStartUp fails if it's being called from an 
  64. unallocated memory block, so you must allocate the memory your application 
  65. occupies first.
  66.  
  67.  
  68. Further Reference
  69. _____________________________________________________________________________
  70.   o  Apple IIGS Technical Note #17, Application Startup and the MMStartUp 
  71.      User ID
  72.  
  73.